package ar.edu.unlu.sistemas.movirdroid.business.vo;

import java.io.Serializable;

public class TermFrecuencyVO implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3025768020347592912L;
	private WordVO word;
	private DocumentVO document;
	private Float value;
	private int freq;
	
	public TermFrecuencyVO() {
		
	}
	
	public TermFrecuencyVO(WordVO word, Float value) {
		this.setWord(word);
		this.setValue(value);
	}
	
	
	public int getFreq() {
		return freq;
	}

	public void setFreq(int freq) {
		this.freq = freq;
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof WordVO) {
			return this.getWord().getName().equals(((WordVO) o).getName());
		} if (o instanceof DocumentVO) {
			return this.getDocument().getName().equals(((DocumentVO) o).getName());
		} else if (o instanceof TermFrecuencyVO) {
			return this.getDocument().getName().equals(((TermFrecuencyVO) o).getDocument().getName()) &&
			this.getWord().getName().equals(((TermFrecuencyVO) o).getWord().getName());
		} else {
			return false;
		}
		
	}

	public WordVO getWord() {
		return word;
	}
	public void setWord(WordVO word) {
		this.word = word;
	}
	public DocumentVO getDocument() {
		return document;
	}
	public void setDocument(DocumentVO document) {
		this.document = document;
	}
	public Float getValue() {
		return value;
	}
	public void setValue(Float value) {
		this.value = value;
	}
	public String toString() {
		return this.getWord().getName()+"-"+this.getDocument().getName()+"-"+this.getValue();
	}
	
}
